/* 
 * File:   common.h
 * Author: Faraj
 *
 * Created on May 5, 2013, 4:44 PM
 */

#ifndef COMMON_STR_H
#define	COMMON_STR_H

#include <vector>
#include <string>
#include <sstream>
using namespace std;

namespace lib {
    namespace common {

        class str {
        public:
            static vector<string> explode(const string &delimiter, const string &str);
            static bool contains(string needle, string target);
            static bool startswith(string prefix, string str);
            static bool endswith(string suffix, string str);
            static int to_int(string value);
            static string to_str(int value);
            static string replace(string str, const string& from, const string& to);
            static string replace_all(string str, const string& from, const string& to);
            static string trim(string str);
        };
    };
};
#endif	/* COMMON_STR_H */

